<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const url = 'http://api.react.beer/v2/search?q=hops&type=beer';
        function ajax(url) {
            
            const p = fetch(url).then( res => {
                return res.json();
            }).then( res => console.log(res));

            console.log('11',p);
        }
        ajax(url);

        // function* step() {

        //     let _that = this;
        //     console.log('fetching beers');
        //     const beers = yield ajax('http://api.react.beer/v2/search?q=hops&type=beer');
        //     console.log(beers);

        //     console.log('fetching wes');
        //     const wes = yield ajax('http://api.github.con/users/hotpotliuyu');
        //     console.log(wes);

        //     console.log('fetching fat job');
        //     const fatJob = ajax('http://api.discogs.com/artists/51980');
        //     console.log(fatJob);
        // }



        // const stepGan = step();

    </script>
</body>
</html>